package Box2D.Common.Math
{
	import Box2D.Common.b2Wrapper;
	
	public class b2Vec3 extends b2Wrapper
	{
		public function b2Vec3(wrapper:Object=null)
		{
			if(wrapper==null)
				wrapper = callDirect('b2Vec3_new');
			super(wrapper);
		}
		
		public function get x():Number{return getNumber(0)}
		public function set x(value:Number):void{setNumber(0,value)}
		
		public function get y():Number{return getNumber(4)}
		public function set y(value:Number):void{setNumber(4,value)}
		
		public function get z():Number{return getNumber(8)}
		public function set z(value:Number):void{setNumber(8,value)}
		
		public function Set(x:Number,y:Number,z:Number):void{
			this.x = x;
			this.y = y;
			this.z = z;
		}
		public function SetZero():void{Set(0,0,0)}
		public function Copy(v:b2Vec3):void{
			x = v.x;
			y = v.y;
			z = v.z;
		}
		
		public function SubtractWith(v:b2Vec3):void{
			x-=v.x;
			y-=v.y;
			z-=v.z;
		}
		public function Subtract(v:b2Vec3):b2Vec3{
			var result:b2Vec3 = new b2Vec3;
			result.Copy(this);
			result.SubtractWith(v);
			return result;
		}
		public function AddWith(v:b2Vec3):void{
			x+=v.x;
			y+=v.y;
			z+=v.z;
		}
		public function Add(v:b2Vec3):b2Vec3{
			var result:b2Vec3 = new b2Vec3;
			result.Copy(this);
			result.AddWith(v);
			return result;
		}
		public function MultiplyWith(v:b2Vec3):void{
			x*=v.x;
			y*=v.y;
			z*=v.z;
		}
		public function Multiply(v:b2Vec3):b2Vec3{
			var result:b2Vec3 = new b2Vec3;
			result.Copy(this);
			result.MultiplyWith(v);
			return result;
		}
	}
}